#include<stdio.h>

int getString( char * source , char *strPtr[] ) ;

int main()
{
    char    str[100005];
    char    *strPtr[1005]={0};
    int        i, num ;

    gets(str);
    num = getString( str , strPtr ) ;
    for( i = 0 ; i < num ; i++ )
        puts(strPtr[i]);

    return 0;    
}

int getString(char *source, char *strPtr[]) {
    if (*source!=' '){
    strPtr[0] = source;}
    else{
        while (*source==' '){
            source++;
        }
        strPtr[0] = source;
    }
    int i = 1;
    while (*source != '\0') {
        if (*source == ' ') {
            *source = '\0';
            if (*(source + 1) != ' '&&*(source + 1) != '\0') {
                strPtr[i] = source + 1;
                i++;
            }
        }
        source++;
    }
    return i;
}
